package com.lobov.entities.hadoop;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.WritableComparable;

public class Container implements WritableComparable {

	private IntWritable posNum = new IntWritable();
	private Text lines1 = new Text();
	private Text lines2 = new Text();
	
	public IntWritable getPosNum() {
		return posNum;
	}

	public void setPosNum(IntWritable posNum) {
		this.posNum = posNum;
	}

	public Text getLines1() {
		return lines1;
	}

	public void setLines1(Text lines1) {
		this.lines1 = lines1;
	}

	public Text getLines2() {
		return lines2;
	}

	public void setLines2(Text lines2) {
		this.lines2 = lines2;
	}

	@Override
	public void write(DataOutput out) throws IOException {
		lines1.write(out);
		lines2.write(out);
		posNum.write(out);
	}

	@Override
	public void readFields(DataInput in) throws IOException {
		lines1.readFields(in);
		lines2.readFields(in);
		posNum.readFields(in);
	}

	@Override
	public int compareTo(Object o) {
		// TODO Auto-generated method stub
		return 0;
	}
	
	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append(lines1.toString() + "\n");
		sb.append(lines2.toString() + "\n");
		
		sb.append("\n");
		sb.append(posNum);
		return sb.toString();
	}

}
